<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Ots  : Hello World Coder</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="Ots Wang" /><meta name="description" content="Hugo theme even example site." /><meta name="keywords" content="Hugo, theme, even" />






<meta name="generator" content="Hugo 0.60.1 with theme even" />


<link rel="canonical" href="http://localhost:1313/" />
  <link href="http://localhost:1313/index.xml" rel="alternate" type="application/rss+xml" title="Ots  : Hello World Coder" />
  <link href="http://localhost:1313/index.xml" rel="feed" type="application/rss+xml" title="Ots  : Hello World Coder" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">


<link href="/dist/even.c2a46f00.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="Ots  : Hello World Coder" />
<meta property="og:description" content="Hugo theme even example site." />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://localhost:1313/" />
<meta property="og:updated_time" content="2019-12-25T00:00:00+00:00" />
<meta itemprop="name" content="Ots  : Hello World Coder">
<meta itemprop="description" content="Hugo theme even example site."><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Ots  : Hello World Coder"/>
<meta name="twitter:description" content="Hugo theme even example site."/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">OtsWang</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">Home</li>
      </a><a href="/post/">
        <li class="mobile-menu-item">Archives</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">Tags</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">Categories</li>
      </a>
  </ul>
</nav>
  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">OtsWang</a>
</div>

<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">Home</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/post/">Archives</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">Tags</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">Categories</a>
      </li>
  </ul>
</nav>
    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <section id="posts" class="posts">
    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/design/prototype/">原型模式</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-12-24 </span>
      <div class="post-category">
          <a href="/categories/design/"> Design </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <p>原型模式是通过clone而不是构造函数进行新的对象的创建。而可以通过clone进行创建的前提条件是类的各属性可以深拷贝。</p>
    </div>
    <div class="read-more">
      <a href="/post/design/prototype/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/design/factory/">工厂方法模式</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-12-24 </span>
      <div class="post-category">
          <a href="/categories/design/"> Design </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <p>本文包括了对工厂方法模式和抽象工厂模式的介绍。</p>
<p>工厂方法模式，定义了对象和创建对象的接口。</p>
<p>工厂方法模式非常符合“开闭原则”，当需要增加一个新的产品时，我们只需要增加一个具体的产品类和与之对应的具体工厂即可，无须修改原有系统。同时在工厂方法模式中用户只需要知道生产产品的具体工厂即可，无须关系产品的创建过程，甚至连具体的产品类名称都不需要知道。虽然他很好的符合了“开闭原则”，但是由于每新增一个新产品时就需要增加两个类，这样势必会导致系统的复杂度增加。</p>
    </div>
    <div class="read-more">
      <a href="/post/design/factory/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/design/single/">单例模式</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-12-24 </span>
      <div class="post-category">
          <a href="/categories/design/"> Design </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <p>单例模式，它的定义就是确保某一个类只有一个实例，并且提供一个全局访问点。共有五种形式：懒汉模式，懒汉双重校验锁模式，饿汉模式，内部类模式，枚举模式。现在最推荐的方式是枚举单例模式。</p>
    </div>
    <div class="read-more">
      <a href="/post/design/single/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/java/multithread/">Java多线程</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-12-19 </span>
      <div class="post-category">
          <a href="/categories/java/"> Java </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <p>多线程，对cpu资源的合理利用。
对Java线程安全的定义为：当多个线程访问同一个类时，如果不用考虑这些线程在运行时环境下的调度和交替运行，并且不需要额外的同步及在调用方式代码不必做其他的协调，这个类任然是正确的，那么这个类就是线程安全的。显然只有在存在资源竞争时才会导致线程不安全，因此，无状态的对象永远是线程安全的。</p>
    </div>
    <div class="read-more">
      <a href="/post/java/multithread/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/other/git/">Git学习</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-12-18 </span>
      <div class="post-category">
          <a href="/categories/other/"> Other </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <p>Git对于提升工作效率具有很好的帮助。</p>
    </div>
    <div class="read-more">
      <a href="/post/other/git/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    </section>
  
  <nav class="pagination">
    <a class="prev" href="/page/14/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text">上一页</span>
      </a>
    <a class="next" href="/page/16/">
        <span class="next-text">下一页</span>
        <i class="iconfont icon-right"></i>
      </a>
  </nav>
        </div>
        

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
  <a href="http://localhost:1313/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  

  <span class="copyright-year">
    &copy; 
    2018 - 
    2019
    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">Ots Wang</span>
  </span>
</div>
    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>
<script type="text/javascript" src="/dist/even.26188efa.min.js"></script>








</body>
</html>
